package com.nutransit;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;

import com.mylibrary.mylibrary.util.SessionData;
import com.nutransit.commoncode.Webservice_parametrs;

public class Splash_screen extends Activity implements Webservice_parametrs
{
	SessionData sessionData;
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_splash);
		
		sessionData = new SessionData(Splash_screen.this, PACKAGE_NAME);

		new Handler().postDelayed(new Runnable()
		{
			@Override
			public void run()
			{
				if(sessionData.getString(TAG_data)!=null)
					startActivity(new Intent(Splash_screen.this, MainActivity_Nutransit.class));
				else
					startActivity(new Intent(Splash_screen.this, Login_Activity.class));
//				startActivity(new Intent(Splash_screen.this, Activity_User_Request.class));
				overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out);
				Splash_screen.this.finish();
			}
		}, 1000);
	}

}
